/**
 * 功能描述
 */
define(function (require, exports, module) {
	var Component = require("subnav");
    var instance = {
        initComponent: function (params, widget) {
            var subnav = new Component({
            	parentNode:".J-subnav",
				model : {
					title:"取现查询统计",
					items : [{
						id : "operateDate",
						type : "daterange",
						tip:"操作时间",
						ranges : {
							"时间":[moment().startOf("year"),  moment()],
						},
						defaultRange: "时间",
						handler : function(time){
							widget.get("grid").refresh(null,function(data){
				        		 var j = 0;
				                 for(var i in data){
				                 	 j += parseFloat(data[i].price);
				                 }
				                 widget.get("grid").setTitle("取现合计："+j+"元 ");
				        	});
						}
					}]
				}
            });
            widget.set("subnav", subnav);
        }
    };
    module.exports = instance;
});
